// 组件创建后
async function defineComponentCreated({ VueInstance, VueElement }) {
  if (VueElement && VueInstance) {
    newMapDate = VueElement.id;
    if (newMapDate) {
      echarts.registerMap(newMapDate, mapGeoJson);
      VueInstance.options.geo[0].map = newMapDate;
      VueInstance.options.series[3].map = newMapDate;
    } else {
      echarts.registerMap(VueElement ? VueElement.id : timeDate, mapGeoJson);
    }
  }
  const myChart = VueInstance.getEChartInstance();
  timer = setInterval(() => {
    //数据情况重绘，清除formatter移动效果，也可根据自身需求是否需要，删除这两行代码
    /*option.series[seriesjson[runidx].createType-1].data = [];
        myChart.setOption(option, true);*/
    for (var i = 0; i < 3; i++) {
      VueInstance.options.series[i].data = [];
    }
    var cityIndex = Math.floor(Math.random() * 13);
    var runidx = Math.floor(Math.random() * 3);
    var coordCity = Object.keys(center)[cityIndex];
    var coord = center[coordCity];
    VueInstance.options.series[runidx].data = [
      {
        city: coordCity,
        value: coord,
      },
    ];
    // console.log(option.series[runidx].data)
    // console.log("---",VueInstance.options.series[4].data)
    // VueInstance.options.series[4].data = VueInstance.options.series[4].data.sort(function(a,b){
    //     return b.value-a.value;
    // });
    myChart.setOption(VueInstance.options, true);
  }, Math.floor(Math.random() * 10000) + 1000);
}
